var table = new tree.ui.Table();

var store = new tree.ui.Store({ Key: tree.ui.TYPES.string, Value: tree.ui.TYPES.string });

var listview = new tree.ui.Listview(store);

var toolbar = new tree.ui.HBox();
toolbar.add(new tree.ui.Button('Button1'));
toolbar.add(new tree.ui.Button('Button2'));
toolbar.add(new tree.ui.Button('Button3'));
table.add(toolbar, 0, 0, null, '20%');
toolbar.set_style('width', 'auto');

table.add(listview, 0, 1);

var proxy = new tree.io.rpc.JSON_Proxy('/rpc');

data = proxy.call_method('database.documents.get_all', []);

for(var key in data)
{
    var value = data[key];
    store.append([key, tree.io.formats.json.dump(value)]);
}

document.body.appendChild(table.show());
